<?php
/**
 * Created by PhpStorm.
 * User: HarrisHuang
 * Date: 17/6/1
 * Time: 18:44
 */
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Website;
use Log;

class WebsiteController extends Controller
{

    public function update(Request $request)
    {
        $id = 1;
        $website = Website::find($id);
        if(!$website){
            return $this->error();
        }
        $website->icon = $request->input('icon');
        $website->logo = $request->input('logo');
        $website->picture = $request->input('picture');
        $website->link = $request->input('link');
        $website->copyright = $request->input('copyright');
        $website->icp = $request->input('icp');
        $website->save();
        return $this->success($request->input('icon'));
    }

    public function info(Request $request)
    {
        //$id = (int)$request->get('id');
        $res = Website::find(1);
        return $this->success($res);
    }

    public function mobileInfo(Request $request)
    {
        $res = Website::find(1);
        return $this->success($res);
    }


}